#include "DebugFactory.h"
#include "DebugConsole.h"
#include "writer.h"

namespace AllTing
{

namespace Test
{

Debug* DebugFactory::Instance()
{
	// Support only visual studio
	static CompositeWritable theCompositeWriter_;
	static StdOutWriter theStdOutWriter_;
    
	static OutputDebugStringWriter theWinWriter_;

    if(theCompositeWriter_.empty())
    {
        theCompositeWriter_.AddWriter(&theStdOutWriter_);
        theCompositeWriter_.AddWriter(&theWinWriter_);
    }
    
	static DebugConsole theDebug_(&theCompositeWriter_);

	return &theDebug_;
}
    

}	// namespace Test

}	// namespace AllTing